import datetime
from dataclasses import dataclass

from dc_shop.core.models.enums.order import DeliveryMethod, OrderStatus


@dataclass(frozen=True)
class OrderLineDTO:
    product_id: int
    quantity: int


@dataclass(frozen=True)
class OrderDTO:
    id: int
    status: OrderStatus | None = None
    summ: float | None = None
    buyer_db_id: int | None = None
    shop_id: int | None = None
    payment_method_id: int | None = None
    delivery_method: DeliveryMethod | None = None
    shipping_address: str | None = None
    user_phone: str | None = None
    tracking_link: str | None = None
    invoice_screenshot_path: str | None = None
    created_at: datetime.datetime | None = None


@dataclass(frozen=True)
class OrderWithDetailsDTO(OrderDTO):
    order_lines: list[OrderLineDTO] | None = None
    currency_symbol: str | None = None
